import 'package:flutter/foundation.dart';
import 'package:flutter/services.dart';

import 'applemusicauth_plugin_t_platform_interface.dart';

/// An implementation of [ApplemusicauthPlugin_tPlatform] that uses method channels.
class MethodChannelApplemusicauthPlugin_t extends ApplemusicauthPlugin_tPlatform {
  /// The method channel used to interact with the native platform.
  @visibleForTesting
  final methodChannel = const MethodChannel('applemusicauth_plugin_t');

  @override
  Future<String?> getPlatformVersion() async {
    final version = await methodChannel.invokeMethod<String>('getPlatformVersion');
    return version;
  }

  @override
  Future<Map<String, dynamic>?> getAppleMusicAuth(String developerToken) async {
    final map = await methodChannel.invokeMapMethod<String, dynamic>("getAppleMusicAuth",{"developerToken": developerToken});
    return map;
  }

  @override
  Future<Map<String, dynamic>?> getAppleMusic(String baoName) async {
    final map = await methodChannel.invokeMapMethod<String, dynamic>("getAppleMusic",{"baoName": baoName});
    return map;
  }
}
